<template>
    <div style="padding:20px">
        <el-table
          :data="studentList"
          style="width: 80%;margin:0 auto;">
        <el-table-column
            label="ID"
            prop="sid"
            align="center"
            width="180">
        </el-table-column>
        <el-table-column
            label="学生姓名"
            align="center"
            prop="sname">
        </el-table-column>
        <el-table-column
            label="性别"
            align="center"
            prop="sex">
        </el-table-column>
        <el-table-column
            label="年龄"
            align="center"
            prop="age">
        </el-table-column>
        <el-table-column
            label="所属班级"
            align="center"
            prop="cid">
        </el-table-column>
        <el-table-column label="操作" align="center">
          <template slot-scope="scope">
            <el-button
                size="mini"
                @click="editStudentInfo()">编辑</el-button>
            <el-button
                size="mini"
                type="danger"
                @click="deleteStudent()">删除</el-button>
          </template>
        </el-table-column>
      </el-table>
    </div>
</template>
<script>
export default {
   name:'StudentTest',
   data() {
      return {
        studentList:[]
      }
   },
   created(){
    this.$get("/student/list").then((res)=>{
       console.log(res)
       this.studentList = res.data.students
    })
   },
   methods:{
     editStudentInfo(){

     },
     deleteStudent(){
        
     }
   },
}
</script>
<style lang="scss" scoped>

</style>
